$(document).ready(function() {
	showLoading();
	$('title', parent.document).html($('title').text());
	setBaseUrl();
	addTitle("branchCompanySave");
	searchBranchCompany();
});
function searchBranchCompany() {
	createComBody("detailOneBody", branchCompanyTable, undefined, 1);
	$("#branchCompanyID").attr("readonly", false);
	setTimeout(hideLoading, 500);
}
function saveBranchCompany(data){
     var result = data && data.result;
     if (result == "Success") {
    	 showMessge(messageContent["Insert.Success"], undefined, goback);
     } else if (result == "NotFound"){
    	 showMessge(messageContent["Insert.Failed"]);
     } else if (result == "BranchCompanyIDExist"){
         showMessge(messageContent["BranchCompany.BranchCompanyIDExist"]);
     } else if (result == "BranchCompanyNameExist"){
         showMessge(messageContent["BranchCompany.BranchCompanyNameExist"]);
     } else {
    	 showMessge(messageContent["Insert.Error"]);
     }
}
function confirm(){
	return checkForm("saveForm", branchCompanyTable);
}
function goback() {
	window.parent.skipMenu('chargingStation/branchCompany', 'drownDown1', '', 'chargingStationPage', 'branchCompany');
}